package com.bytech.common.biz.service.remote.article;

import java.util.Collection;
import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bytech.common.biz.entity.article.Article;
import com.bytech.common.biz.entity.article.ArticleDto;
import com.bytech.common.biz.entity.article.ArticleQuery;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import com.bytech.common.biz.entity.articleTag.ArticleTag;
import com.bytech.common.biz.entity.articleTag.ArticleTagDto;
import com.bytech.common.biz.entity.articleTag.ArticleTagQuery;
import com.bytech.common.biz.entity.base.BaseResult;

/**
 * 远程文章服务客户端 标签的接口也写在文章服务里面
 *
 * @Author zhao
 * @Create 2021/8/415:50
 */
@FeignClient("service-blog-article")
public interface RemoteArticleService {

    /*article 相关*/
    @GetMapping("/article/articleCount")
    BaseResult<Integer> getArticleCount();

    @GetMapping("/article/getArticleById")
    BaseResult<ArticleDto> getArticleById(@RequestParam("articleId") String articleId);

    @GetMapping("/article/getArticleByIds")
    List<Article> getArticleByIds(@RequestParam("articleIds") Collection<String> articleId);

    @PostMapping("/article/save/")
    BaseResult<Article> saveArticle(@RequestBody ArticleDto article);

    @PostMapping("/article/pageArticleByQuery")
    BaseResult<Page<ArticleDto>> pageArticleByQuery(@RequestBody ArticleQuery<Article> articleQuery);

    @PostMapping("/article/delete")
    BaseResult<String> deleteArticleById(@RequestParam String id);

    @PostMapping("/article/physicalDelete")
    BaseResult<String> physicalDeleteArticleById(@RequestParam String id);

    /*tag 相关*/
    @GetMapping("/articleTag/getAllUsable")
    List<ArticleTag> getAllUsableTag();

    @GetMapping("/articleTag/getTagById")
    BaseResult<ArticleTagDto> getTagById(@RequestParam String id);

    @PostMapping("/articleTag/save/")
    BaseResult<ArticleTag> saveTag(@RequestBody ArticleTagDto tagDto);

    @PostMapping("/articleTag/pageTagByQuery")
    BaseResult<Page<ArticleTagDto>> pageTagByQuery(@RequestBody ArticleTagQuery<ArticleTag> tagQuery);

    @PostMapping("/articleTag/delete")
    BaseResult<String> deleteTagById(@RequestParam String id);
}
